<template>
    <div class="newest_item">
        <div class="left">
            <el-row>
                <el-col :span="24" class="dw_title">
                    <span class="type-border">
                        {{item.dwtype}}:
                    </span>
                    <span class="dw">
                        {{item.company}}
                    </span>

                    <span 
                    class="link" 
                    v-if="isShow === '1'"
                    @click="portraitsClick(item)" 
                    >
                        查看企业画像
                    </span>
                </el-col>

                <el-col :span="24" class="notice_title">
                    <span>
                        {{item.noticetype}}：
                    </span>

                    <span class="notice">
                        {{item.notice}}
                    </span>

                    <span 
                    class="link" 
                    @click="noticeClick(item)" 
                    v-if="isShow === '1'"
                    >
                        查看详情
                    </span>
                </el-col>
            </el-row>

            <div class="detail">
                <span class="city">
                    地点：{{item.area}}
                </span>

                <span class="industry">
                    行业：{{item.industry}}
                </span>

                <span class="price">
                    预算金额：{{Math.floor(item.price)/10000}} 万元
                </span>
                <span class="publishtime">
                    {{item.publishtime}}
                </span>
                
                <br>

                <template>
                    <span class="contact">
                        业主联系人：{{item.contact || '-'}}
                    </span>

                    <span class="mobile">
                        联系电话：{{item.mobile || '-'}}
                    </span>

                    <span 
                    class="contact" 
                    v-if="item.dwtype === '中标单位'"
                    >
                        中标项目经理：{{item.anothercontact}}
                    </span>

                    <span 
                    class="mobile" 
                    v-if="item.anothermobile && item.dwtype === '中标单位'"
                    >
                        联系电话：{{item.anothermobile}}
                    </span>
                </template>

                <span 
                class="link" 
                @click="noticeClick(item)" 
                v-if="isShow === '1'"
                >
                    查看该项目经理负责的其他项目信息
                </span>
            </div>

        </div>
        <div class="right">
            <el-button 
            type="text" 
            v-if="isShow !== '1'"
            @click="showDetail(item)" 
            >
                查看
            </el-button>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        item: {
            type: Object,
            default: () => {},
        },
        index: {
            type: Number,
            default: 0,
        },
        isShow: {
            type: String,
            default: '',
        },
        isHaveSee: {
            type: Boolean,
            default: false,
        },
    },
    data() {
        return {
            type:'',
        };
    },
    mounted() {},
    methods: {
        // 企业画像
        portraitsClick(item) {
            this.$emit('portraitsClick', item);
        },
        // 公告
        noticeClick(item) {
            this.$emit('noticeClick', item);
        },
        // 查看按钮
        showDetail(item) {
            item.index = this.index;
            this.$emit('showDetail', item);
        },
    },
};
</script>

<style lang="scss" scoped>
@import '@css/var.scss';

.newest_item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #d8dce5;

    .left {
        flex: 1;
        line-height: 2em;
        .dw_title {
            font-weight: bold;
            ::v-deep {
                .type-border {
                    display: inline-block;
                    // padding: 0 10px;
                    // border: 1px dashed #3e7fff;
                    // margin: 10px 5px 10px 0;
                }
            }
            .dw {
                cursor: pointer;
            }
            .link {
                color: $primaryColor;
                margin-left: 20px;
                cursor: pointer;
                border-bottom: 1px solid $primaryColor;
                font-weight: normal;
            }
        }
        .notice_title {
            .notice {
                color: $primaryColor;
                cursor: default;
            }
            .link {
                color: $primaryColor;
                margin-left: 10px;
                cursor: pointer;
                border-bottom: 1px solid $primaryColor;
            }
        }
        .detail {
            span {
                display: inline-block;
            }
            .city {
                width: 160px;
            }
            .industry {
                min-width: 140px;
                margin-right: 20px;
            }
            .price {
                width: 200px;
            }

            .contact {
                width: 160px;
            }
            .mobile {
                // width: 180px;
                display: inline-block;
                margin-right: 50px;
            }

            .link {
                color: $primaryColor;
                margin-left: 10px;
                cursor: pointer;
                border-bottom: 1px solid $primaryColor;
                line-height: normal;
            }
        }
    }

    .right {
        width: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
</style>
